package com.dabai.iot.core.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * 物模型功能模块输入类
 *
 * @author kev1n
 */
@Data
public class ThingModelBlockInput implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 产品id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "产品id")
    @NotNull
    private Long productId;

    /**
     * 模块标识符
     */
    @Schema(description = "模块标识符")
    @NotBlank
    @Size(min = 1, max = 32, message = "模块标识符长度必须在1-32之间")
    private String blockIdentifier;

    /**
     * 模块名称
     */
    @Schema(description = "模块名称")
    @NotBlank
    @Size(min = 1, max = 32, message = "模块名称长度必须在1-32之间")
    private String blockName;

}
